home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Deutsche Edition 1
/
Deutsche Edition 1.iso
/
amok
/
051-060
/
amok55
/
m2midi
/
midisupport.mod
< prev
next >
Wrap
Text File
|
1993-11-04
|
2KB
|
68 lines
(***************************************************************************
:Program. MidiSupport.mod
:Author. Jürgen Zimmermann
:Address. Ringstraße 6, 6719 Altleiningen, West-Germany
:Phone. 06356/1456
:ShortCut. [JnZ]
:Support. -
:Version. 1.1
:Date. 8. May 1991
:Copyright. PD
:Language. MODULA-II
:Translator. M2Amiga 4.0d
:Contents. Eine Modulimplementation der "Midi-Marcos" (C!) für
:Contents. Modula-2 User
:Remark. Ich würde mich sehr über Kontakt mit anderen M2Amiga-Usern
:Remark. und MIDI-Freaks freuen.
:Usage. Siehe Anleitung für die Midi-Library (anbei!)
****************************************************************************)
IMPLEMENTATION MODULE MidiSupport;
PROCEDURE MidiHiByte(data: CARDINAL): SHORTCARD;
(* pack high bytes of a word into midi format (7/14 bit math) *)
BEGIN
RETURN (SHORTCARD(data DIV 128));
END MidiHiByte;
PROCEDURE MidiLoByte(data: CARDINAL): SHORTCARD;
(* pack low bytes of a word into midi format (7/14 bit math) *)
BEGIN
RETURN (SHORTCARD(data MOD 128));
END MidiLoByte;
PROCEDURE MidiWord(hi, lo: SHORTCARD): CARDINAL;
(* unpack 2 midi bytes into a word (7/14 bit math) *)
BEGIN
RETURN (CARDINAL(CARDINAL(hi)*128+CARDINAL(lo)));
END MidiWord;
PROCEDURE SplitMidiID(id: LONGCARD;
VAR id0,id1,id2: SHORTCARD);
(* unpack a 3 byte sys/ex id into single bytes for argument
lists and RIMatch initializers *)
BEGIN
id0:=(SHORTCARD(id DIV 65536));
id1:=(SHORTCARD((id DIV 256) MOD 256));
id2:=(SHORTCARD(id MOD 256));
END SplitMidiID;
PROCEDURE MakeMidiID(id0,id1,id2: SHORTCARD): LONGCARD;
(* make a 3 byte sys/ex id from three single bytes *)
BEGIN
RETURN ((LONGCARD(id0)*65536)
+ (LONGCARD(id1)*256)
+ LONGCARD(id2));
END MakeMidiID;
END MidiSupport.